﻿@section head {
    @if (ViewBag.IsScoreBoard)
    {
        <meta http-equiv="refresh" content="60" />
    }
    
    <style type="text/css">
        h2 {
            padding: 0 0 0px;
            top:0px;
        }
        
        tr.even {
            background-color: #eee;
        }
            tr.odd {
            background-color: LightYellow;
        } 
    </style>
    
    <script>
        $(document).ready(function () {
            $('table.stripe tbody tr:odd').addClass('odd');
            /*$('table.stripe tbody tr:even').addClass('even'); */
        });
    </script>
}

@*
    @if (ViewBag.IsScoreBoard)
    {
       <script type="text/javascript">
           $(document).ready(function() {
                setInterval(function() {
                    var url = '@Url.Action("ScoreBoard", "Score")';
                        $.getJSON(
                            url,
                            null,
                            function(data) {
                                $('#main').html(data);
                            }
                        );
                    },
                    10000
                );
            });
        </script>
    }
}
*@

@{
    ViewBag.Title = "Computing Contest Scoring";
    Layout = "~/Views/Shared/_LayoutIntranet.cshtml";
    string currentContestyear = Qu.ComputingContest.Model.RegistrationRepository.GetCurrentContestYear().ToString();
}

@if (!ViewBag.IsScoreBoard)
{
    <p>
        @Html.ActionLink("Add Score", "add")   |  @Html.ActionLink("Score Board", "scoreboard") |  @Html.ActionLink("Schedule", "schedule") |  @Html.ActionLink("Start Final Round", "startfinalround") |  @Html.ActionLink("Undo Start Final Round", "undostartfinalround")
    </p>
    
    if (TempData["Message"] != null)
    {
        <b><div id="message_bar">@TempData["Message"]</div></b>
    }
}

@if (ViewBag.IsScoreBoard && ViewBag.FinalScores != null)
{
    <center>
        <h2>Qatar University Computing Contest @Html.Raw(currentContestyear) - Final Scores</h2>
    </center>
    
    @Html.Partial("ScoresList", (IEnumerable<Qu.ComputingContest.Model.ScoreSummary>)ViewBag.FinalScores)
}

<center>
    <h2>Qatar University Computing Contest @Html.Raw(currentContestyear) - Score Board</h2>
</center>

@Html.Partial("ScoresList")
